package com.casic.modules.jy.controller;

import java.util.Map;
import com.casic.common.utils.R;
import com.casic.common.base.entity.PageEntity;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.casic.modules.jy.entity.JyKcxxEntity;
import com.casic.modules.jy.service.JyKcxxService;


/**
 * 课程信息表
 * 
 * @author mfc
 * @email 123456789@qq.com
 * @date 2018-09-25 14:55:22
 */
@RestController
@RequestMapping("jykcxx")
public class JyKcxxController {
	@Autowired
	private JyKcxxService jyKcxxService;
	
	/**
	 * 列表
	 */
	@RequestMapping("/list")
	public R list(@RequestParam Map<String, Object> params){
        PageEntity<JyKcxxEntity> page=jyKcxxService.findPage(params);
		return R.ok().put("page", page);
	}
	
	
	/**
	 * 信息
	 */
	@RequestMapping("/info/{id}")
	public R info(@PathVariable("id") String id){
		JyKcxxEntity jyKcxx = jyKcxxService.findById(id);
		return R.ok().put("jyKcxx", jyKcxx);
	}
	
	/**
	 * 保存
	 */
	@RequestMapping("/save")
	public R save(@RequestBody JyKcxxEntity jyKcxx){
		jyKcxxService.save(jyKcxx);
		return R.ok();
	}
	
	/**
	 * 修改
	 */
	@RequestMapping("/update")
	public R update(@RequestBody JyKcxxEntity jyKcxx){
		jyKcxxService.edit(jyKcxx);
		return R.ok();
	}
	
	/**
	 * 删除
	 */
	@RequestMapping("/delete")
	public R delete(@RequestBody String[] ids){
		jyKcxxService.removeByIds(ids);
		return R.ok();
	}
	
}
